package com.xiaoxi.prototypemode;

import com.xiaoxi.prototypemode.manager.ProductManager;
import com.xiaoxi.prototypemode.product.IProduct;
import com.xiaoxi.prototypemode.product.MessageBoxProduct;
import com.xiaoxi.prototypemode.product.UnderlinePenProduct;

/**
 * @ClassName Main
 * @Description
 * @Author xiaoxi
 * @Date 2023/3/12 15:03
 * @Version 1.0
 */
public class Main {
    public static void main(String[] args) {
        ProductManager productManager = new ProductManager();

        IProduct messageBoxProduct = new MessageBoxProduct('*');
        IProduct messageBoxWithMod = new MessageBoxProduct('/');
        IProduct underlinePenProduct = new UnderlinePenProduct('~');

        System.out.println(messageBoxProduct);
        System.out.println(underlinePenProduct);

        productManager.register("messageBox", messageBoxProduct);
        productManager.register("messageBoxWithMod", messageBoxWithMod);
        productManager.register("underline", underlinePenProduct);

        productManager.cloneProduct("messageBox").use("Hello,World!");
        productManager.cloneProduct("underline").use("Hello,World!");
        productManager.cloneProduct("messageBoxWithMod").use("Hello,World!");

    }
}
